-
Notifications
You must be signed in to change notification settings - Fork 202
Add Server count metric #760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: yolossn The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
this patch adds server count metric fixes: kubernetes-sigs#521 Signed-off-by: yolossn <[email protected]>
0a4a49c
to
b31592d
Compare
@@ -389,6 +389,8 @@ func NewProxyServer(serverID string, proxyStrategies []proxystrategies.ProxyStra | |||
} | |||
} | |||
|
|||
metrics.Metrics.SetServerCount(serverCount) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe serverCount is the value passed in from the command line. https://github.com/kubernetes-sigs/apiserver-network-proxy/blob/v0.33.0/cmd/server/app/server.go#L141 is the only place I know its set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, do you want me to move this SetServerCount to /cmd/server/app/server.go
itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. I was more thinking that this is the API configured server count, not necessarily the actual server count. It does not actually tell you many servers are up, just how many we advertise to the agents. Even with that the agents themselves will periodically attempt to detect if there are more than advertised.
The server lease for instance (if used) has an actual count of the number of servers which are running.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah my bad, got your point now.
Since the agent already has the lease informer, should we add the server_count
metric to the agent (i.e., the NewLeaseInformerWithMetrics) or create a new lease informer in the server pkg and use it in the server?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on further investigation came across this, looks like the agent already exposes the known_server_count
metric.
serverCount := prometheus.NewGauge( |
this patch adds server count metric
fixes: #521